package com.adjaisd.scarecrow.testJava;

import com.adjaisd.scarecrow.common.utils.GeoUtils;
import com.adjaisd.scarecrow.vo.GeoCoordinate;
import org.assertj.core.util.Strings;
import org.junit.jupiter.api.Test;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

public class test {

    @Test
    void testCode() {
//        String[] split = "1,5,2,1,3,2,1,9,2".split(",");
//        List<String> strings = Lists.newArrayList(split);
//        HashSet<String> set = Sets.newHashSet(strings);
//        System.out.println(set);

//        String s = new Date().getTime() * 1000 * 1000 + "";
//        System.out.println(s);

        List<String> list = new LinkedList<>();
        for (int i = 0; i < 100; i++) list.add(i + "");
        String with = Strings.join(list).with("|");
        System.out.println(with);
        String join = String.join("|", list);
        System.out.println(join);
    }

    @Test
    void testRandomLocation() {
        GeoCoordinate cen = new GeoCoordinate(118, 32);
        for (int i = 0; i < 10; i++) {
            GeoCoordinate loca = GeoUtils.getRandomLocation(cen, 1000);
            System.out.println(loca);
        }
    }

}